
public class shiyan1_1 {
    public static boolean funIsPrime(int n) {
        if (n % 6 != 1 && n % 6 != 5)
            return false;
        else {
            for (int i = 5; i <= Math.sqrt(n); i += 6) {
                if (n % i == 0 || n % (i + 2) == 0)
                    return false;
            }
            return true;
        }
    }

    public static void main(String[] args) {
        int ans=0;
        for (int i = 101; i <= 200; i++) {
            if (funIsPrime(i)) {
                System.out.println(i);
                ans++;
            }
        }
        System.out.println("一共有素数");
        System.out.println(ans);
    }
}
